﻿package Game
{

	public class Match
	{
		private var teams:Vector.<Team>;
		private var players:Vector.<Player>;
		public function Match()
		{
		}
		
		public function  initialize() {
			teams = new Vector.<Team>();
			players = new Vector.<Player>();		
		}
		
		public function getPlayer(index:int):Player {
			return players[index];
		}
		
		public function getTeam(index:int):Team {
			return teams[index];
		}
		
		public function addPlayer(player:Player,team_index:int) {
			players.push(player);
			if(teams.length == team_index ) teams.push(new Team());
			teams[team_index].addPlayer(player);
		}
		
		public function get player_number():int { return players.length; }
		public function get team_number():int { return teams.length; }
		
	}

}